package com.fudan.framework.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fudan.framework.entity.RequestEntity;
import com.fudan.framework.entity.TableJson;

/**
 * 列表接口
 * @author Xuxinxing
 *
 * @param <T>
 */
public interface ListController<T extends RequestEntity> extends FunctionalController<T>{
	@RequestMapping("/list")
	@ResponseBody
	default public TableJson list(HttpServletRequest request) {
		return TableJson.build(injectService().pages(request), injectService().countAll());
	}
	
	@RequestMapping("/qlist")
	@ResponseBody
	default public TableJson qList(HttpServletRequest request) {
		return TableJson.build(injectService().pages(request), injectService().countAll());
	}
}
